'''
    邮件和日志
'''
import yagmail,logging

class Tools():
    # 日志
    def log(self):
        log = logging.basicConfig(level=logging.DEBUG
                                  , filemode='a+'
                                  , format='%(message)s %(funcName)s %(thread)d  %(levelname)s %(filename)s %(asctime)s'
                                  , filename='a3mall.log')
        return log

    # 邮件
    def e_mail(self):
        email = yagmail.SMTP(user='zzh2834326498@qq.com',password='rbtbgahnvdwaddbf',host='smtp.qq.com',port=465)
        email.send(to='zzh2834326498@qq.com',subject='a3mall系统Web Ui自动化测试报告',contents='a3mall'
                   ,attachments=[r'C:\Users\张震海\Desktop\month_1\month_8_8\Run\a3mall.log',r'C:\Users\张震海\Desktop\month_1\month_8_8\Run\html\index.html'])